#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
using namespace std;
vector<int>ans;
int n;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n;
		int m = n * (n - 1) / 2;
		ans.clear();
		for (int i = 0; i < m; i++) {
			int x;
			cin >> x;
			ans.push_back(x);
		}
		sort(ans.begin(), ans.end());
		for (int i = 0; i < m; i += n) {
			cout << ans[i] << " ";
			n--;
		}
		cout << 1000000000 << endl;
	}
	return 0;
}